package com.fr.report;

import com.fr.base.ColumnRow;
import com.fr.base.StringUtils;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLReadable;
import com.fr.base.xml.XMLableReader;
import com.fr.chart.Chart;
import com.fr.chart.ChartCollection;
import com.fr.chart.Title;
import com.fr.chart.axis.Axis;
import com.fr.chart.axis.ValueAxis;
import com.fr.chart.plot.CategoryPlot;
import com.fr.chart.plot.RadarPlot;
import com.fr.chart.plot.RangePlot;
import com.fr.chart.plot.StockPlot;
import com.fr.chart.plot.XYScatterPlot;
import com.fr.data.DBManipulation;
import com.fr.data.TableData;
import com.fr.data.core.DataXMLUtils;
import com.fr.data.core.define.FilterDefinition;
import com.fr.data.core.define.ReportDataDefinition;
import com.fr.data.core.define.ReportDataDefinition.SeriesEntry;
import com.fr.report.cellElement.CellExpandAttr;
import com.fr.report.cellElement.Formula;
import com.fr.report.cellElement.FormulaPresent;
import com.fr.report.cellElement.Present;
import com.fr.report.cellElement.core.ConditionGroup;
import com.fr.report.cellElement.core.CustomGrouper;
import com.fr.report.cellElement.core.DSColumn;
import com.fr.report.cellElement.core.SelectCount;
import com.fr.report.core.headerfooter.FormulaHFElement;
import com.fr.report.core.headerfooter.HFElement;
import com.fr.report.highlight.AbstractHighlight;
import com.fr.report.highlight.Highlight;
import com.fr.report.highlight.HighlightGroup;
import com.fr.report.io.ReportExportAttr;
import com.fr.report.io.xml.SynchronizedVersion;
import com.fr.report.web.WebForm;
import com.fr.report.web.WebPage;
import com.fr.report.web.WebWrite;
import com.fr.report.write.BuiltInSQLSubmiter;
import com.fr.report.write.config.ColumnConfig;
import com.fr.report.write.config.DMLConfig;
import java.util.List;

public abstract class AbstractTemplateReport extends AbstractReport
  implements TemplateReport
{
  protected ReportWriteAttr reportWriteAttr;
  public static final String REPORT_NAME_COMPATIBLE0651WORKSHEET = "Compatible0651WorkSheet";

  public TemplateWorkBook getTemplateWorkBook()
  {
    return ((TemplateWorkBook)super.getBook());
  }

  public void setTemplateWorkBook(TemplateWorkBook paramTemplateWorkBook)
  {
    super.setBook(paramTemplateWorkBook);
  }

  public ReportWriteAttr getReportWriteAttr()
  {
    return this.reportWriteAttr;
  }

  public void setReportWriteAttr(ReportWriteAttr paramReportWriteAttr)
  {
    this.reportWriteAttr = paramReportWriteAttr;
  }

  public Object cloneWithoutCellCase()
    throws CloneNotSupportedException
  {
    AbstractTemplateReport localAbstractTemplateReport = (AbstractTemplateReport)super.cloneWithoutCellCase();
    if (getReportWriteAttr() != null)
      localAbstractTemplateReport.setReportWriteAttr((ReportWriteAttr)getReportWriteAttr().clone());
    return localAbstractTemplateReport;
  }

  protected void insertChangeCellElement(CellElement paramCellElement, AbstractReport.MOD_COLUMN_ROW paramMOD_COLUMN_ROW)
  {
    Object localObject1 = paramCellElement.getValue();
    if (localObject1 instanceof ChartCollection)
    {
      localObject2 = (ChartCollection)localObject1;
      insertChangeChartCollection((ChartCollection)localObject2, paramMOD_COLUMN_ROW);
    }
    if (localObject1 instanceof Formula)
    {
      localObject2 = (Formula)localObject1;
      ((Formula)localObject2).setContent(paramMOD_COLUMN_ROW.mod_fm_statement(((Formula)localObject2).getContent().substring(1)));
    }
    else if (localObject1 instanceof DSColumn)
    {
      int i;
      paramMOD_COLUMN_ROW.mod_condition(((DSColumn)localObject1).getCondition());
      localObject2 = ((DSColumn)localObject1).getGrouper();
      if (localObject2 instanceof CustomGrouper)
      {
        localObject3 = ((CustomGrouper)localObject2).getConditionGroups();
        for (i = 0; i < localObject3.length; ++i)
          paramMOD_COLUMN_ROW.mod_condition(localObject3[i].getCondition());
      }
      if (((DSColumn)localObject1).getSortFormula() != null)
        ((DSColumn)localObject1).setSortFormula(paramMOD_COLUMN_ROW.mod_fm_statement(((DSColumn)localObject1).getSortFormula()));
      if ((((DSColumn)localObject1).getSelectCount() != null) && (((DSColumn)localObject1).getSelectCount().getFormulaCount() != null))
        ((DSColumn)localObject1).getSelectCount().setFormulaCount(paramMOD_COLUMN_ROW.mod_fm_statement(((DSColumn)localObject1).getSelectCount().getFormulaCount()));
      if (((DSColumn)localObject1).getResult() != null)
        ((DSColumn)localObject1).setResult(paramMOD_COLUMN_ROW.mod_fm_statement(((DSColumn)localObject1).getResult()));
    }
    Object localObject2 = paramCellElement.getCellExpandAttr();
    if (localObject2 != null)
    {
      localObject3 = ((CellExpandAttr)localObject2).getLeftParentColumnRow();
      ((CellExpandAttr)localObject2).setLeftParentColumnRow(paramMOD_COLUMN_ROW.mod_columnrow((ColumnRow)localObject3));
      ColumnRow localColumnRow = ((CellExpandAttr)localObject2).getUpParentColumnRow();
      ((CellExpandAttr)localObject2).setUpParentColumnRow(paramMOD_COLUMN_ROW.mod_columnrow(localColumnRow));
    }
    Object localObject3 = paramCellElement.getHighlightGroup();
    if (localObject3 != null)
    {
      int j = 0;
      int k = ((HighlightGroup)localObject3).size();
      while (j < k)
      {
        Highlight localHighlight = ((HighlightGroup)localObject3).getHighlight(j);
        if (localHighlight instanceof AbstractHighlight)
          paramMOD_COLUMN_ROW.mod_condition(((AbstractHighlight)localHighlight).getCondition());
        ++j;
      }
    }
    Present localPresent = paramCellElement.getPresent();
    if (localPresent instanceof FormulaPresent)
    {
      FormulaPresent localFormulaPresent = (FormulaPresent)localPresent;
      localFormulaPresent.setFormulaContent(paramMOD_COLUMN_ROW.mod_fm_statement(localFormulaPresent.getFormulaContent()));
    }
  }

  protected Object __mod_column_row(AbstractReport.MOD_COLUMN_ROW paramMOD_COLUMN_ROW)
  {
    Object localObject1;
    int l;
    Object localObject2;
    Object localObject3;
    if (super.__mod_column_row(paramMOD_COLUMN_ROW) == null)
      return null;
    for (int i = 0; i < this.floatElementList.size(); ++i)
    {
      FloatElement localFloatElement = (FloatElement)this.floatElementList.get(i);
      localObject1 = localFloatElement.getValue();
      if (localObject1 instanceof ChartCollection)
      {
        ChartCollection localChartCollection = (ChartCollection)localObject1;
        insertChangeChartCollection(localChartCollection, paramMOD_COLUMN_ROW);
      }
    }
    ReportPageAttr localReportPageAttr = this.reportPageAttr;
    if (localReportPageAttr != null)
    {
      j = -1;
      if ((j = localReportPageAttr.getRepeatHeaderRowFrom()) != -1)
        localReportPageAttr.setRepeatHeaderRowFrom(paramMOD_COLUMN_ROW.mod_columnrow(ColumnRow.valueOf(-1, j)).getRow());
      if ((j = localReportPageAttr.getRepeatHeaderRowTo()) != -1)
        localReportPageAttr.setRepeatHeaderRowTo(paramMOD_COLUMN_ROW.mod_columnrow(ColumnRow.valueOf(-1, j)).getRow());
      if ((j = localReportPageAttr.getRepeatFooterRowFrom()) != -1)
        localReportPageAttr.setRepeatFooterRowFrom(paramMOD_COLUMN_ROW.mod_columnrow(ColumnRow.valueOf(-1, j)).getRow());
      if ((j = localReportPageAttr.getRepeatFooterRowTo()) != -1)
        localReportPageAttr.setRepeatFooterRowTo(paramMOD_COLUMN_ROW.mod_columnrow(ColumnRow.valueOf(-1, j)).getRow());
      if ((j = localReportPageAttr.getRepeatHeaderColumnFrom()) != -1)
        localReportPageAttr.setRepeatHeaderColumnFrom(paramMOD_COLUMN_ROW.mod_columnrow(ColumnRow.valueOf(j, -1)).getColumn());
      if ((j = localReportPageAttr.getRepeatHeaderColumnTo()) != -1)
        localReportPageAttr.setRepeatHeaderColumnTo(paramMOD_COLUMN_ROW.mod_columnrow(ColumnRow.valueOf(j, -1)).getColumn());
      if ((j = localReportPageAttr.getRepeatFooterColumnFrom()) != -1)
        localReportPageAttr.setRepeatFooterColumnFrom(paramMOD_COLUMN_ROW.mod_columnrow(ColumnRow.valueOf(j, -1)).getColumn());
      if ((j = localReportPageAttr.getRepeatFooterColumnTo()) != -1)
        localReportPageAttr.setRepeatFooterColumnTo(paramMOD_COLUMN_ROW.mod_columnrow(ColumnRow.valueOf(j, -1)).getColumn());
    }
    for (int j = 0; j <= 4; ++j)
    {
      if (getHeader(j) != null)
      {
        localObject1 = getHeader(j);
        for (l = 0; l < ((ReportHF)localObject1).getLeftList().size(); ++l)
        {
          localObject2 = (HFElement)((ReportHF)localObject1).getLeftList().get(l);
          if (localObject2 instanceof FormulaHFElement)
          {
            localObject3 = ((FormulaHFElement)localObject2).getFormulaContent();
            if (localObject3 != null)
              ((FormulaHFElement)localObject2).setFormulaContent(paramMOD_COLUMN_ROW.mod_fm_statement((String)localObject3));
          }
        }
        for (l = 0; l < ((ReportHF)localObject1).getCenterList().size(); ++l)
        {
          localObject2 = (HFElement)((ReportHF)localObject1).getCenterList().get(l);
          if (localObject2 instanceof FormulaHFElement)
          {
            localObject3 = ((FormulaHFElement)localObject2).getFormulaContent();
            if (localObject3 != null)
              ((FormulaHFElement)localObject2).setFormulaContent(paramMOD_COLUMN_ROW.mod_fm_statement((String)localObject3));
          }
        }
        for (l = 0; l < ((ReportHF)localObject1).getRightList().size(); ++l)
        {
          localObject2 = (HFElement)((ReportHF)localObject1).getRightList().get(l);
          if (localObject2 instanceof FormulaHFElement)
          {
            localObject3 = ((FormulaHFElement)localObject2).getFormulaContent();
            if (localObject3 != null)
              ((FormulaHFElement)localObject2).setFormulaContent(paramMOD_COLUMN_ROW.mod_fm_statement((String)localObject3));
          }
        }
      }
      if (getFooter(j) != null)
      {
        localObject1 = getFooter(j);
        for (l = 0; l < ((ReportHF)localObject1).getLeftList().size(); ++l)
        {
          localObject2 = (HFElement)((ReportHF)localObject1).getLeftList().get(l);
          if (localObject2 instanceof FormulaHFElement)
          {
            localObject3 = ((FormulaHFElement)localObject2).getFormulaContent();
            if (localObject3 != null)
              ((FormulaHFElement)localObject2).setFormulaContent(paramMOD_COLUMN_ROW.mod_fm_statement((String)localObject3));
          }
        }
        for (l = 0; l < ((ReportHF)localObject1).getCenterList().size(); ++l)
        {
          localObject2 = (HFElement)((ReportHF)localObject1).getCenterList().get(l);
          if (localObject2 instanceof FormulaHFElement)
          {
            localObject3 = ((FormulaHFElement)localObject2).getFormulaContent();
            if (localObject3 != null)
              ((FormulaHFElement)localObject2).setFormulaContent(paramMOD_COLUMN_ROW.mod_fm_statement((String)localObject3));
          }
        }
        for (l = 0; l < ((ReportHF)localObject1).getRightList().size(); ++l)
        {
          localObject2 = (HFElement)((ReportHF)localObject1).getRightList().get(l);
          if (localObject2 instanceof FormulaHFElement)
          {
            localObject3 = ((FormulaHFElement)localObject2).getFormulaContent();
            if (localObject3 != null)
              ((FormulaHFElement)localObject2).setFormulaContent(paramMOD_COLUMN_ROW.mod_fm_statement((String)localObject3));
          }
        }
      }
    }
    ReportWriteAttr localReportWriteAttr = this.reportWriteAttr;
    if (localReportWriteAttr != null)
    {
      int k = localReportWriteAttr.getSubmiterCount();
      for (l = 0; l < k; ++l)
      {
        localObject2 = localReportWriteAttr.getSubmiter(l);
        if ((localObject2 instanceof BuiltInSQLSubmiter) && (((BuiltInSQLSubmiter)localObject2).getDBManipulation() != null))
        {
          localObject3 = ((BuiltInSQLSubmiter)localObject2).getDBManipulation().getDmlConfig();
          int i1 = 0;
          int i2 = ((DMLConfig)localObject3).getColumnConfigCount();
          while (i1 < i2)
          {
            ColumnConfig localColumnConfig = ((DMLConfig)localObject3).getColumnConfig(i1);
            Object localObject4 = localColumnConfig.getColumnValue();
            if (localObject4 instanceof ColumnRow)
              localColumnConfig.setColumnValue(paramMOD_COLUMN_ROW.mod_columnrow((ColumnRow)localObject4));
            else if ((localObject4 instanceof String) && (((String)localObject4).startsWith("=")));
            ++i1;
          }
        }
      }
    }
    return paramMOD_COLUMN_ROW;
  }

  private void insertChangeChartCollection(ChartCollection paramChartCollection, AbstractReport.MOD_COLUMN_ROW paramMOD_COLUMN_ROW)
  {
    Object localObject1;
    Object localObject2;
    Object localObject3;
    Object localObject4;
    int j;
    Object localObject5;
    FilterDefinition localFilterDefinition = paramChartCollection.getFilterDefinition();
    if (localFilterDefinition instanceof ReportDataDefinition)
    {
      ReportDataDefinition localReportDataDefinition = (ReportDataDefinition)localFilterDefinition;
      localObject1 = localReportDataDefinition.getCategoryNameString();
      localObject2 = localReportDataDefinition.getSeriesNameString();
      localObject3 = localReportDataDefinition.getSeriesValueString();
      localObject4 = localReportDataDefinition.getSeriesList();
      if (localObject1 != null)
        localReportDataDefinition.setCategoryNameString(paramMOD_COLUMN_ROW.mod_fm_statement((String)localObject1));
      if (localObject2 != null)
        localReportDataDefinition.setSeriesNameString(paramMOD_COLUMN_ROW.mod_fm_statement((String)localObject2));
      if (localObject3 != null)
        localReportDataDefinition.setSeriesValueString(paramMOD_COLUMN_ROW.mod_fm_statement((String)localObject3));
      for (j = 0; j < ((List)localObject4).size(); ++j)
      {
        localObject5 = ((List)localObject4).get(j);
        if (localObject5 instanceof ReportDataDefinition.SeriesEntry)
        {
          ReportDataDefinition.SeriesEntry localSeriesEntry = (ReportDataDefinition.SeriesEntry)localObject5;
          String str1 = localSeriesEntry.getSeriesName();
          Object localObject6 = localSeriesEntry.getValue();
          String str2 = localObject6.toString();
          if (str1 != null)
            localSeriesEntry.setSeriesName(paramMOD_COLUMN_ROW.mod_fm_statement(str1));
          if (str2 != null)
            localSeriesEntry.setValue(paramMOD_COLUMN_ROW.mod_fm_statement(str2));
        }
      }
    }
    for (int i = 0; i < paramChartCollection.getChartSize(); ++i)
    {
      localObject1 = paramChartCollection.getChart(i);
      dealWithTitle(((Chart)localObject1).getTitle(), paramMOD_COLUMN_ROW);
      localObject2 = ((Chart)localObject1).getPlot();
      if (localObject2 instanceof CategoryPlot)
      {
        localObject3 = ((CategoryPlot)localObject2).getCategoryAxis();
        dealWithTitle(((Axis)localObject3).getTitle(), paramMOD_COLUMN_ROW);
        localObject4 = ((CategoryPlot)localObject2).getValueAxis();
        dealWithTitle(((ValueAxis)localObject4).getTitle(), paramMOD_COLUMN_ROW);
        dealValueAlertFormula((ValueAxis)localObject4, paramMOD_COLUMN_ROW);
      }
      else
      {
        ValueAxis localValueAxis;
        if (localObject2 instanceof XYScatterPlot)
        {
          localObject3 = (XYScatterPlot)localObject2;
          localObject4 = ((XYScatterPlot)localObject3).getXAxis();
          dealWithTitle(((ValueAxis)localObject4).getTitle(), paramMOD_COLUMN_ROW);
          dealValueAlertFormula((ValueAxis)localObject4, paramMOD_COLUMN_ROW);
          localValueAxis = ((XYScatterPlot)localObject3).getYAxis();
          dealWithTitle(localValueAxis.getTitle(), paramMOD_COLUMN_ROW);
          dealValueAlertFormula(localValueAxis, paramMOD_COLUMN_ROW);
        }
        else if (localObject2 instanceof RadarPlot)
        {
          localObject3 = ((RadarPlot)localObject2).getRadarAxis();
          dealWithTitle(((Axis)localObject3).getTitle(), paramMOD_COLUMN_ROW);
        }
        else if (localObject2 instanceof StockPlot)
        {
          localObject3 = (StockPlot)localObject2;
          localObject4 = ((StockPlot)localObject3).getCategoryAxis();
          dealWithTitle(((Axis)localObject4).getTitle(), paramMOD_COLUMN_ROW);
          localValueAxis = ((StockPlot)localObject3).getPriceAxis();
          dealWithTitle(localValueAxis.getTitle(), paramMOD_COLUMN_ROW);
          dealValueAlertFormula(localValueAxis, paramMOD_COLUMN_ROW);
          localObject5 = ((StockPlot)localObject3).getVolumeAxis();
          if (localObject5 != null)
          {
            dealWithTitle(((ValueAxis)localObject5).getTitle(), paramMOD_COLUMN_ROW);
            dealValueAlertFormula((ValueAxis)localObject5, paramMOD_COLUMN_ROW);
          }
        }
        else if (localObject2 instanceof RangePlot)
        {
          localObject3 = (RangePlot)localObject2;
          localObject4 = ((RangePlot)localObject3).getValueAxis();
          dealWithTitle(((ValueAxis)localObject4).getTitle(), paramMOD_COLUMN_ROW);
          dealValueAlertFormula((ValueAxis)localObject4, paramMOD_COLUMN_ROW);
        }
      }
    }
  }

  private void dealWithTitle(Title paramTitle, AbstractReport.MOD_COLUMN_ROW paramMOD_COLUMN_ROW)
  {
    if ((paramTitle != null) && (paramTitle.getTextObject() instanceof Formula))
    {
      Object localObject = paramTitle.getTextObject();
      Formula localFormula = (Formula)localObject;
      localFormula.setContent(paramMOD_COLUMN_ROW.mod_fm_statement(localFormula.getContent().substring(1)));
      paramTitle.setTextObject(localFormula);
    }
  }

  private void dealValueAlertFormula(ValueAxis paramValueAxis, AbstractReport.MOD_COLUMN_ROW paramMOD_COLUMN_ROW)
  {
    if (paramValueAxis.hasAlertValue())
    {
      Object localObject = paramValueAxis.getAlertValue();
      if (localObject instanceof Formula)
      {
        Formula localFormula = (Formula)localObject;
        localFormula.setContent(paramMOD_COLUMN_ROW.mod_fm_statement(localFormula.getContent().substring(1)));
        paramValueAxis.setAlertValue(localFormula);
      }
    }
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    super.readXML(paramXMLableReader);
    if (paramXMLableReader.isChildNode())
    {
      Object localObject1;
      String str = paramXMLableReader.getTagName();
      if (getTemplateWorkBook() != null)
        if ("Compatible0651WorkSheet".equals(getTemplateWorkBook().getReportName(0)))
        {
          if ("TableDataMap".equals(str))
          {
            paramXMLableReader.readXMLObject(new XMLReadable(this)
            {
              private final AbstractTemplateReport this$0;

              public void readXML()
              {
                if (paramXMLableReader.isAttr())
                  this.this$0.getTemplateWorkBook().clearAllTableData();
                if (paramXMLableReader.isChildNode())
                {
                  String str = paramXMLableReader.getAttr("name");
                  if ("NameTableData".equals(paramXMLableReader.getTagName()))
                  {
                    paramXMLableReader.readXMLObject(new AbstractTemplateReport.2(this, str));
                  }
                  else
                  {
                    TableData localTableData = DataXMLUtils.readXMLTableData(paramXMLableReader);
                    this.this$0.getTemplateWorkBook().putTableData(str, localTableData);
                  }
                }
              }

              static AbstractTemplateReport access$000(1 param1)
              {
                return param1.this$0;
              }
            });
          }
          else if ("ReportWebAttr".equals(str))
          {
            localObject1 = getTemplateWorkBook().getReportWebAttr();
            if (localObject1 == null)
            {
              localObject1 = new ReportWebAttr();
              getTemplateWorkBook().setReportWebAttr((ReportWebAttr)localObject1);
            }
            paramXMLableReader.readXMLObject((XMLReadable)localObject1);
          }
          else if ("ReportParameterAttr".equals(str))
          {
            localObject1 = getTemplateWorkBook().getReportParameterAttr();
            if (localObject1 == null)
            {
              localObject1 = new ReportParameterAttr();
              getTemplateWorkBook().setReportParameterAttr((ReportParameterAttr)localObject1);
            }
            paramXMLableReader.readXMLObject((XMLReadable)localObject1);
          }
          else if ("ReportExportAttr".equals(str))
          {
            localObject1 = getTemplateWorkBook().getReportExportAttr();
            if (localObject1 == null)
            {
              localObject1 = new ReportExportAttr();
              getTemplateWorkBook().setReportExportAttr((ReportExportAttr)localObject1);
            }
            paramXMLableReader.readXMLObject((XMLReadable)localObject1);
          }
        }
        else
        {
          Object localObject2;
          int i;
          if (SynchronizedVersion.getSynchronizedVersion(Thread.currentThread()).getVersion() < 6.5D)
            if ("TableDataMap".equals(str))
            {
              paramXMLableReader.readXMLObject(new XMLReadable(this)
              {
                private final AbstractTemplateReport this$0;

                public void readXML()
                {
                  if (paramXMLableReader.isChildNode())
                  {
                    String str = paramXMLableReader.getAttr("name");
                    if ("NameTableData".equals(paramXMLableReader.getTagName()))
                    {
                      paramXMLableReader.readXMLObject(new AbstractTemplateReport.4(this, str));
                    }
                    else
                    {
                      TableData localTableData = DataXMLUtils.readXMLTableData(paramXMLableReader);
                      this.this$0.getTemplateWorkBook().putTableData(str, localTableData);
                    }
                  }
                }

                static AbstractTemplateReport access$100(3 param3)
                {
                  return param3.this$0;
                }
              });
            }
            else if ("ReportParameterAttr".equals(str))
            {
              localObject1 = new ReportParameterAttr();
              paramXMLableReader.readXMLObject((XMLReadable)localObject1);
              if (getTemplateWorkBook().getReportParameterAttr() == null)
              {
                getTemplateWorkBook().setReportParameterAttr((ReportParameterAttr)localObject1);
              }
              else
              {
                localObject2 = ((ReportParameterAttr)localObject1).getParameters();
                for (i = 0; i < localObject2.length; ++i)
                  getTemplateWorkBook().getReportParameterAttr().addParameter(localObject2[i]);
              }
            }
          if ((getTemplateWorkBook() != null) && ("ReportWebAttr".equals(str)))
          {
            if (!(SynchronizedVersion.isAfterREPORT_REFECT_FOR65_XML_VERSION()))
            {
              localObject1 = new ReportWebAttr();
              paramXMLableReader.readXMLObject((XMLReadable)localObject1);
              localObject2 = getTemplateWorkBook().getReportWebAttr();
              if (localObject2 == null)
              {
                getTemplateWorkBook().setReportWebAttr((ReportWebAttr)localObject1);
              }
              else
              {
                if (((ReportWebAttr)localObject1).getWebPage() != null)
                  if (((ReportWebAttr)localObject2).getWebPage() == null)
                    ((ReportWebAttr)localObject2).setWebPage(((ReportWebAttr)localObject1).getWebPage());
                  else if (((ReportWebAttr)localObject2).getWebPage().getToolBarManagers() == null)
                    ((ReportWebAttr)localObject2).getWebPage().setToolBarManagers(((ReportWebAttr)localObject1).getWebPage().getToolBarManagers());
                if (((ReportWebAttr)localObject1).getWebWrite() != null)
                  if (((ReportWebAttr)localObject2).getWebWrite() == null)
                    ((ReportWebAttr)localObject2).setWebWrite(((ReportWebAttr)localObject1).getWebWrite());
                  else if (((ReportWebAttr)localObject2).getWebWrite().getToolBarManagers() == null)
                    ((ReportWebAttr)localObject2).getWebWrite().setToolBarManagers(((ReportWebAttr)localObject1).getWebWrite().getToolBarManagers());
                if (((ReportWebAttr)localObject1).getWebForm() != null)
                  if (((ReportWebAttr)localObject2).getWebForm() == null)
                    ((ReportWebAttr)localObject2).setWebForm(((ReportWebAttr)localObject1).getWebForm());
                  else if (((ReportWebAttr)localObject2).getWebForm().getToolBarManagers() == null)
                    ((ReportWebAttr)localObject2).getWebForm().setToolBarManagers(((ReportWebAttr)localObject1).getWebForm().getToolBarManagers());
                if ((((ReportWebAttr)localObject1).getEmailManager() != null) && (((ReportWebAttr)localObject2).getEmailManager() == null))
                  ((ReportWebAttr)localObject2).setEmailManager(((ReportWebAttr)localObject1).getEmailManager());
                if ((((ReportWebAttr)localObject1).getBackground() != null) && (((ReportWebAttr)localObject2).getBackground() == null))
                  ((ReportWebAttr)localObject2).setBackground(((ReportWebAttr)localObject1).getBackground());
                if ((((ReportWebAttr)localObject1).getPrinter() != null) && (((ReportWebAttr)localObject2).getPrinter() == null))
                  ((ReportWebAttr)localObject2).setPrinter(((ReportWebAttr)localObject1).getPrinter());
                i = 0;
                int j = ((ReportWebAttr)localObject1).getCSSImportCount();
                while (i < j)
                {
                  ((ReportWebAttr)localObject2).addCSSImport(((ReportWebAttr)localObject1).getCSSImport(i));
                  ++i;
                }
                i = 0;
                j = ((ReportWebAttr)localObject1).getJSImportCount();
                while (i < j)
                {
                  ((ReportWebAttr)localObject2).addJSImport(((ReportWebAttr)localObject1).getJSImport(i));
                  ++i;
                }
                if ((StringUtils.isNotBlank(((ReportWebAttr)localObject1).getTitle())) && (StringUtils.isBlank(((ReportWebAttr)localObject2).getTitle())))
                  ((ReportWebAttr)localObject2).setTitle(((ReportWebAttr)localObject1).getTitle());
              }
            }
          }
          else if ((getTemplateWorkBook() != null) && ("ReportExportAttr".equals(str)))
          {
            localObject1 = getTemplateWorkBook().getReportExportAttr();
            if (localObject1 == null)
            {
              localObject1 = new ReportExportAttr();
              getTemplateWorkBook().setReportExportAttr((ReportExportAttr)localObject1);
              paramXMLableReader.readXMLObject((XMLReadable)localObject1);
            }
          }
        }
      if ("ReportWriteAttr".equals(str))
      {
        localObject1 = new ReportWriteAttr();
        paramXMLableReader.readXMLObject((XMLReadable)localObject1);
        setReportWriteAttr((ReportWriteAttr)localObject1);
      }
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    super.writeXML(paramXMLPrintWriter);
    ReportWriteAttr localReportWriteAttr = getReportWriteAttr();
    if (localReportWriteAttr != null)
      localReportWriteAttr.writeXML(paramXMLPrintWriter);
  }
}